package Elevator;

/**
 * Created by Connor Madden.
 * User: Connor Madden
 * Date: 7/10/11
 * Time: 12:33 PM
 */
public class ElevatorStateClosing implements ElevatorStateI {
    public ElevatorStateClosing(Elevator elevator) {
        final Elevator threadElevator = elevator;
        Thread closingTimer = new Thread(new Runnable() {
            public void run() {
                try {
                    Thread.sleep(threadElevator.getClosingTime());
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                threadElevator.setStateObject(new ElevatorStateStopped());
            }
        });
    }

    public boolean move(Elevator elevator, float destination) {
        return false; //TODO
    }

    public boolean openDoor(Elevator elevator) {
        return false;
    }

    public boolean closeDoor(Elevator elevator) {
        return false;
    }

    public Elevator.State getState() {
        return Elevator.State.CLOSING;
    }
}
